package xuanmu.office.excel.data.generator.entity;

import lombok.*;

@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
public class RowData implements Comparable<RowData> {

    private String date; //日期

    private String licensePlate; //车牌号
    private String structureType; //结构类型
    private Double ratedLoadCapacity; //额定载重

    private String departure; //路线起点
    private String destination; //路线终点
    private Integer distance; //单次里程（公里）

    private String cargoType; //货物类型

    private Double ratedLoadCapacityCopy; //单次货运量（吨）

    private Integer tripCount; //运输总趟次
    private Double cargoVolume; //当月货运量

    private Integer totalTripDistance; //总里程（公里）
    private Double turnoverVolume; //周转量（吨公里）

    @Override
    public int compareTo(RowData o) {
        int dateComparison = date.compareTo(o.getDate());
        if (dateComparison != 0) {
            return dateComparison;
        }
        return licensePlate.compareTo(o.getLicensePlate());
    }

    //日期、车牌号、结构类型、额定载重、线路、货物类型、
    //单次里程（公里）、 运输总趟次、月货运量、总里程（公里）、周转量（吨公里）
    @Override
    public String toString() {
        return
                "日期=" + date +
                        ", 车牌号=" + licensePlate +
                        ", 结构类型=" + structureType +
                        ", 额定载重=" + ratedLoadCapacity +
                        ", 货物类型=" + cargoType +
                        ", 线路=" + departure + "-" + destination +
                        ", 单次里程（公里）=" + distance +
                        ", 运输总趟次=" + tripCount +
                        ", 总里程（公里）=" + totalTripDistance +
                        ", 当月货运量=" + cargoVolume +
                        ", 周转量（吨公里）=" + turnoverVolume;
    }

}
